录制视频为.wmv格式,8秒钟的视频700多k
using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Text;using System.Windows.Forms;using SheXiangTou;namespace SheXiangTouTest{ public partial class Form1 : Form { SheXiangTou.mSheXiangTou msxt = null; public Form1() { InitializeComponent(); } private void Form1_Load(object sender, EventArgs e) { this.MaximumSize = new Size(this.Width, this.Height); this.MinimumSize = new Size(this.Width, this.Height); try { msxt = new mSheXiangTou(pictureBox1); List<string> temp = null; if ((temp = msxt.GetVideoDevicesNameList) != null) { foreach (string str in temp) { comboBox1.Items.Add(str); } comboBox1.SelectedIndex = 0; } Open.Click = new EventHandler(Open_Click); Close.Click = new EventHandler(msxt.Close_Click); LuXiang.Click = new EventHandler(msxt.LuXiang_Click); Stop.Click = new EventHandler(msxt.TingZhi_Click); PaiZhao.Click = new EventHandler(msxt.PaiZhao_Click); FormClosing = new FormClosingEventHandler(msxt.Form_FormClosing); } catch (Exception q) { MessageBox.Show(q.Message); Application.Exit(); } } void Open_Click(object sender, EventArgs e) { if (comboBox1.SelectedIndex == -1) return; msxt.Open_Click(comboBox1.SelectedIndex); } private void isShowTimeC_CheckedChanged(object sender, EventArgs e) { msxt.SetShowTime = isShowTimeC.Checked; } }}
评论